package com.leoman.utils;

import com.leoman.user.entity.UserInfo;

import java.util.List;
import java.util.Timer;
import java.util.TimerTask;

/**
 * Created by Administrator on 2016/3/10.
 */
public class MessageTimerWork extends TimerTask {

    private Timer timer = null;

    public List<UserInfo> userInfoList;

    public String content;

    public MessageTimerWork(List<UserInfo> userInfoLists, Timer timer1, String contentInfo) {
        timer = timer1;
        userInfoList = userInfoLists;
        content = contentInfo;
    }

    @Override
    public void run() {
        doExecute();
        timer.cancel();
    }

    private void doExecute() {
        SendMsgThread sendMsgThread = new SendMsgThread();
        sendMsgThread.setUserInfoList(userInfoList);
        sendMsgThread.setContent(content);
        sendMsgThread.run();
    }
}
